<?php

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();

?>
  <div id="category-content" class="container_12">
    <div id="category-title">
      <img src="<?php bloginfo('template_directory'); ?>/images/butterfly.png" />
      <h2><?php echo single_cat_title( '', false ); ?></h2>
    </div>
    
    
    <?php
    if(have_posts()){
    
      $category = get_the_category();
      $parent = $category[0]->category_parent;
      $c_parent = get_cat_name($parent);
      $all_posts = get_posts("category=".$category[0]->cat_ID);
      
      foreach($all_posts as $post){
        $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    ?>
    <div class="<?php echo $c_parent; ?> grid_3">
      <a href="<?php echo get_permalink($post->ID); ?>">
        <img src="<?php echo $feat_image; ?>" class="grid_3" />
        <p><?php echo substr($post->post_content, 0, 55) ?>..</p>
      </a>
    </div>
    <?php }} ?>
  </div>
  
<?php

    // action hook for placing content below #container
    thematic_belowcontainer();

    // calling footer.php
    get_footer();

?>
